class MySet {
    constructor() {
        this.items = {};
    }

    has(value) {
        return this.items.hasOwnProperty(value);
    }

    add(value) {
        if (!this.has(value)) {
            this.items[value] = value;
            return true;
        } else {
            return false;
        }
    }


    remove(value) {
        if (this.has(value)) {
            delete this.items[value];
            return true;
        } else {
            return false;
        }
    }

    clear() {
        this.items = {};
    }
    size() {
        return this.items.size;
    }
    keys() {
        let keys = [];
        for (let key in this.items) {
            // if (this.items.hasOwnProperty(key)) {
            keys.push(key);
            // }
        }
        return keys;
    }

    values() {
        let values = [];
        for (let value in this.items) {
            // if (this.items.hasOwnProperty(value)) {
            values.push(this.items[value]);
            // }
        }
        return values;
    }
}

const a = new MySet()
a.add(5)
// a.remove(5)
console.log(a);